//
//	GDUserInfo.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "GDUserInfo.h"

NSString *const kGDUserInfoAvatar = @"avatar";
NSString *const kGDUserInfoCreateTime = @"createTime";
NSString *const kGDUserInfoIdField = @"id";
NSString *const kGDUserInfoJpushId = @"jpushId";
NSString *const kGDUserInfoNickname = @"nickname";
NSString *const kGDUserInfoOpenId = @"openId";
NSString *const kGDUserInfoSex = @"sex";
NSString *const kGDUserInfoUserName = @"userName";

@interface GDUserInfo ()
@end
@implementation GDUserInfo




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kGDUserInfoAvatar] isKindOfClass:[NSNull class]]){
		self.avatar = dictionary[kGDUserInfoAvatar];
	}	
	if(![dictionary[kGDUserInfoCreateTime] isKindOfClass:[NSNull class]]){
		self.createTime = dictionary[kGDUserInfoCreateTime];
	}	
	if(![dictionary[kGDUserInfoIdField] isKindOfClass:[NSNull class]]){
		self.idField = dictionary[kGDUserInfoIdField];
	}	
	if(![dictionary[kGDUserInfoJpushId] isKindOfClass:[NSNull class]]){
		self.jpushId = dictionary[kGDUserInfoJpushId];
	}	
	if(![dictionary[kGDUserInfoNickname] isKindOfClass:[NSNull class]]){
		self.nickname = dictionary[kGDUserInfoNickname];
	}	
	if(![dictionary[kGDUserInfoOpenId] isKindOfClass:[NSNull class]]){
		self.openId = dictionary[kGDUserInfoOpenId];
	}	
	if(![dictionary[kGDUserInfoSex] isKindOfClass:[NSNull class]]){
		self.sex = dictionary[kGDUserInfoSex];
	}	
	if(![dictionary[kGDUserInfoUserName] isKindOfClass:[NSNull class]]){
		self.userName = dictionary[kGDUserInfoUserName];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.avatar != nil){
		dictionary[kGDUserInfoAvatar] = self.avatar;
	}
	if(self.createTime != nil){
		dictionary[kGDUserInfoCreateTime] = self.createTime;
	}
	if(self.idField != nil){
		dictionary[kGDUserInfoIdField] = self.idField;
	}
	if(self.jpushId != nil){
		dictionary[kGDUserInfoJpushId] = self.jpushId;
	}
	if(self.nickname != nil){
		dictionary[kGDUserInfoNickname] = self.nickname;
	}
	if(self.openId != nil){
		dictionary[kGDUserInfoOpenId] = self.openId;
	}
	if(self.sex != nil){
		dictionary[kGDUserInfoSex] = self.sex;
	}
	if(self.userName != nil){
		dictionary[kGDUserInfoUserName] = self.userName;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.avatar != nil){
		[aCoder encodeObject:self.avatar forKey:kGDUserInfoAvatar];
	}
	if(self.createTime != nil){
		[aCoder encodeObject:self.createTime forKey:kGDUserInfoCreateTime];
	}
	if(self.idField != nil){
		[aCoder encodeObject:self.idField forKey:kGDUserInfoIdField];
	}
	if(self.jpushId != nil){
		[aCoder encodeObject:self.jpushId forKey:kGDUserInfoJpushId];
	}
	if(self.nickname != nil){
		[aCoder encodeObject:self.nickname forKey:kGDUserInfoNickname];
	}
	if(self.openId != nil){
		[aCoder encodeObject:self.openId forKey:kGDUserInfoOpenId];
	}
	if(self.sex != nil){
		[aCoder encodeObject:self.sex forKey:kGDUserInfoSex];
	}
	if(self.userName != nil){
		[aCoder encodeObject:self.userName forKey:kGDUserInfoUserName];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.avatar = [aDecoder decodeObjectForKey:kGDUserInfoAvatar];
	self.createTime = [aDecoder decodeObjectForKey:kGDUserInfoCreateTime];
	self.idField = [aDecoder decodeObjectForKey:kGDUserInfoIdField];
	self.jpushId = [aDecoder decodeObjectForKey:kGDUserInfoJpushId];
	self.nickname = [aDecoder decodeObjectForKey:kGDUserInfoNickname];
	self.openId = [aDecoder decodeObjectForKey:kGDUserInfoOpenId];
	self.sex = [aDecoder decodeObjectForKey:kGDUserInfoSex];
	self.userName = [aDecoder decodeObjectForKey:kGDUserInfoUserName];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	GDUserInfo *copy = [GDUserInfo new];

	copy.avatar = [self.avatar copy];
	copy.createTime = [self.createTime copy];
	copy.idField = [self.idField copy];
	copy.jpushId = [self.jpushId copy];
	copy.nickname = [self.nickname copy];
	copy.openId = [self.openId copy];
	copy.sex = [self.sex copy];
	copy.userName = [self.userName copy];

	return copy;
}
@end